package com.tsysms.application;

import javax.swing.JOptionPane;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tsystems.protocol.client.ClientPassenger;
import com.tsysytems.gui.LoginPanel;
import com.tsysytems.gui.MainPanel;

public class ClientApplication {

	private final Logger logger = LoggerFactory.getLogger(getClass());

	public ClientApplication() {

		logger.info("Client start");

		if (!ClientPassenger.getInstance().init()) {
			logger.info("Can't connect to server");
			JOptionPane.showMessageDialog(null,
					"Не удалось подключиться серверу!");
			return;
		}

		if (LoginPanel.showDialog() != null) {
			MainPanel.showFrame();
		}
	}

	public static void main(String[] args) {
		new ClientApplication();
	}

}
